package com.ml.springboot.controller;

import com.ml.springboot.pojo.VO.BlogCountVO;
import com.ml.springboot.pojo.VO.LeaveVO;
import com.ml.springboot.service.ILeaveTypeService;
import com.ml.springboot.service.ILeaveService;
import com.ml.springboot.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/echarts")
public class EChartsController {
    @Autowired
    private ILeaveTypeService blogTypeService;
    @Autowired
    private ILeaveService leaveService;
    @RequestMapping("/toECharts")
    public String toEcharts(){
        return "echarts";


    }
    @RequestMapping("/leaveCount")
    @ResponseBody
    public Result leaveCount(){
        List<LeaveVO> list =leaveService.leaveCount();
        return Result.ok(list);
    }
    @RequestMapping("/blogCount")
    @ResponseBody
    public Result blogCount(){
       List<BlogCountVO> list =blogTypeService.blogCount();
       return Result.ok(list);

    }


}
